<?php
include_once("./function.php");
function add($table,$link,$arr)
{
	$key='';$value='';
	foreach($arr as $k=>$v)
	{
		$key.=$k.",";
		$value.="'$v'".",";

	}
	//echo $key;die;

	$key=substr($key,0,-1);
	$value=substr($value,0,-1);
    $sql="insert into $table($key)values($value)";
    $res=mysqli_query($link,$sql);

    if($res)
    {
	  if(mysqli_affected_rows($link)>0)
	  {
		return true;
	  }
	  else
	  {
		return false;
	  }
    }
	else
	{
		return false;
	}
}
?>